import request from '@/utils/request'

// 用户注册
export const userRegisterService = ({username,password,repassword}) =>
  request.post('/api/reg',{username,password,repassword})

// 用户登录
export const userLoginService = ({username,password}) =>
  request.post('/api/login',{username,password})

//获取用户信息
export const userInfoService = () =>
  request.get('/my/userinfo')

//获取用户基本信息
export const userBasicInfoService = () =>
  request.get('/my/userinfo')

// 更新用户信息
export const updateUserInfoService = data =>
  request.put('/my/userinfo',data)

// 更新用户密码
export const updateUserPasswordService = data =>
  request.patch('/my/updatepwd',data)

// 更新用户头像
export const updateUserAvatarService = avatar =>
  request.patch('/my/update/avatar',{ avatar })
